package com.example.java8;

public class Java8TestDefault {
    public static void main(String args[]){
        Vehicle vehicle = new Car2();
        vehicle.print();
    }
}

interface Vehicle {
    default void print(){
        System.out.println("我是一辆车!");
    }

    static void blowHorn(){
        System.out.println("按喇叭!!!");
    }
}

interface FourWheeler extends  Vehicle {
    @Override
    default void print(){
        System.out.println("我是一辆四轮车!");
    }
}

class Car implements  FourWheeler,Vehicle {


}

class Car2 extends Car implements   FourWheeler {


}
